<!doctype html>
<html>
<head>
	<title>神经学组病例读片会</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<!-- 优先使用 IE 最新版本和 Chrome -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<!-- 启用360浏览器的极速模式(webkit) -->
	<link rel="shortcut icon" type="image/ico" href="/favicon.ico"/>
	<!-- 添加 favicon icon -->
	<meta name="renderer" content="webkit">
	<link rel="stylesheet" href="css/public3.css" />
	<link rel="stylesheet" href="css/reset1.css" />
	<script src="js/font-size.js" type="text/javascript"></script>
	<script src="js/jquery-2.1.1.min.js"></script>
<script>


//支持
function support(){

	var value = 1 ;
	$.ajax( {
		url : "vote?answer=" + value ,
		type : 'post' ,
		datatype : 'json' , 
		success : function( data ){
			console.info(" data info =" + data );
			
			if ( data == '0000' ) {
				isSuccess = 1 ;
				$("#error").text("投票成功");
				$("#error").css({"color":"red"});
				//alert("提交成功" + data);
			}else if ( data == '00001' ) {
				isSuccess = 1 ;
				$("#error").text("谢谢参与");
				$("#error").css({"color":"red"});
				//alert("提交成功" + data);
			} else if(data == '0001') {
				$("#error").text("投票失败");
				$("#error").css({"color":"red"});
				//alert("提交失败" + data);
			}else if(data == '0002') {
				$("#error").text("投票失败");
				$("#error").css({"color":"red"});
				//alert("问题获取失败" + data);
			}else if(data =="0003"){
				$("#error").text("投票未开始");
				$("#error").css({"color":"red"}); 
			}else if(data =="0004"){
				$("#error").text("已经投票");
				$("#error").css({"color":"red"});
			} else if ( data =="0005" ) {
				$("#error").text("请参考规则");
				$("#error").css({"color":"red"});
			} else if ( data =="000001" ) {
				$("#error").text("您没有登录");
				$("#error").css({"color":"red"});
			} else if ( data == "000007") {
				window.location.href="register.html";
			}
							
		} ,
		error : function(){
			alert( '加载失败' );
		}
		
	});
	
	setTimeout( "clearERROR();" , 3000 );
	
}


//反对
function oppose(){

	var value = 0 ;
	$.ajax( {
		url : "vote?answer=" + value ,
		type : 'post' ,
		datatype : 'json' , 
		success : function( data ){
			if ( data == '0000' ) {
				isSuccess = 1 ;
				$("#error").text("投票成功");
				$("#error").css({"color":"red"});
				//alert("提交成功" + data);
			}else if ( data == '00001' ) {
				isSuccess = 1 ;
				$("#error").text("谢谢参与");
				$("#error").css({"color":"red"});
				//alert("提交成功" + data);
			} else if(data == '0001') {
				$("#error").text("投票失败");
				$("#error").css({"color":"red"});
				//alert("提交失败" + data);
			}else if(data == '0002') {
				$("#error").text("投票失败");
				$("#error").css({"color":"red"});
				//alert("问题获取失败" + data);
			}else if(data =="0003"){
				$("#error").text("投票未开始");
				$("#error").css({"color":"red"}); 
			}else if(data =="0004"){
				$("#error").text("已经投票");
				$("#error").css({"color":"red"});
			} else if ( data =="0005" ) {
				$("#error").text("请参考规则");
				$("#error").css({"color":"red"});
			} else if ( data =="000001" ) {
				$("#error").text("您没有登录");
				$("#error").css({"color":"red"});
			}
							
		} ,
		error : function(){
			alert( '加载失败' );
		}
		
	});
	
	setTimeout( "clearERROR();" , 3000 );
	
}

 
</script>
<body>
	
	<div class="wap_phone">
    	<div class="wap">
        	<h5><span id="error" style="font-size:20px"></span></h5>
        	<form id="registerID" action="register" name="Search">
            	<p class="supporter" onclick="support();"></p>
                <p class="opponent" onclick="oppose();"></p>
            </form>
        </div>
    </div>
		
<script>

function clearERROR(){
	$("#error").text("");
}

</script>
<script>
    	var t=$(window).height()
		$('.wap_phone').css('height',t+'px')
    </script>
</body>
</html>
